﻿
/*----------------------------------------------------------------//
// 文件名：MoGbinfo.cs
// 文件功能描述：实体 MoGbinfo.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoGbinfo
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoGbinfo
	/// </summary>
	public partial class MoGbinfo:ICloneable
	{
		#region 表Gbinfo的字段
		private string _gb_code;
		private string _gb_title;
		private string _gb_subject;
		private int _gb_status;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoGbinfo()
		{
		    
		    
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoGbinfo(MoGbinfo item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoGbinfo(string gb_code,string gb_title,string gb_subject,int gb_status,string rem)
		{
		this._gb_code=gb_code;
		this._gb_title=gb_title;
		this._gb_subject=gb_subject;
		this._gb_status=gb_status;
		this._rem=rem;
		}
		#endregion
		
		#region 表Gbinfo的字段属性
		/// <summary>
		/// GB_CODE
		/// </summary>
		public string Gb_Code
		{
			get {return _gb_code;}
			set {_gb_code=value;}
		}
		/// <summary>
		/// GB_TITLE
		/// </summary>
		public string Gb_Title
		{
			get {return _gb_title;}
			set {_gb_title=value;}
		}
		/// <summary>
		/// GB_SUBJECT
		/// </summary>
		public string Gb_Subject
		{
			get {return _gb_subject;}
			set {_gb_subject=value;}
		}
		/// <summary>
		///在用，还是作废。
		/// </summary>
		public int Gb_Status
		{
			get {return _gb_status;}
			set {_gb_status=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoGbinfo CopyTo(MoGbinfo item)
        {
		    item.Gb_Code=this.Gb_Code;
		    item.Gb_Title=this.Gb_Title;
		    item.Gb_Subject=this.Gb_Subject;
		    item.Gb_Status=this.Gb_Status;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoGbinfo NewGbinfo=new MoGbinfo();
		    NewGbinfo._gb_code=this._gb_code;
		    NewGbinfo._gb_title=this._gb_title;
		    NewGbinfo._gb_subject=this._gb_subject;
		    NewGbinfo._gb_status=this._gb_status;
		    NewGbinfo._rem=this._rem;
			return NewGbinfo;
		}
		
		private static MoGbinfo _empty = new MoGbinfo(string.Empty,string.Empty,string.Empty,-1,string.Empty);
        public static MoGbinfo Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoGbinfo NewGbinfo = obj as MoGbinfo;
                if (NewGbinfo == null)
                {
                    return false;
                }
                else
                {
				if (NewGbinfo.Gb_Code==this.Gb_Code && NewGbinfo.Gb_Title==this.Gb_Title && NewGbinfo.Gb_Subject==this.Gb_Subject && NewGbinfo.Gb_Status==this.Gb_Status && NewGbinfo.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Gb_Code={0}/Gb_Title={1}/Gb_Subject={2}/Gb_Status={3}/Rem={4}",_gb_code,_gb_title,_gb_subject,_gb_status,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["GB_Code"]!=null && row["GB_Code"]!=DBNull.Value)
			{
			    this.Gb_Code = (string)row["GB_Code"];
			}
			else
			{
				this.Gb_Code =string.Empty;
			}
		    if(row["GB_Title"]!=null && row["GB_Title"]!=DBNull.Value)
			{
			    this.Gb_Title = (string)row["GB_Title"];
			}
			else
			{
				this.Gb_Title =string.Empty;
			}
		    if(row["GB_Subject"]!=null && row["GB_Subject"]!=DBNull.Value)
			{
			    this.Gb_Subject = (string)row["GB_Subject"];
			}
			else
			{
				this.Gb_Subject =string.Empty;
			}
		    if(row["GB_Status"]!=null && row["GB_Status"]!=DBNull.Value)
			{
			    this.Gb_Status = (int)row["GB_Status"];
			}
			else
			{
				this.Gb_Status =-1;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["GB_Code"] = this.Gb_Code;
			row["GB_Title"] = this.Gb_Title;
			row["GB_Subject"] = this.Gb_Subject;
			row["GB_Status"] = this.Gb_Status;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
